<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/22
  Time: 17:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>职位管理</title>
    <link href="../../css/mine.css" type="text/css" rel="stylesheet" />
    <%--<script type="text/javascript" src="/qimingxing/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript">
        function deptn() {
            alert("函数触发")
            if (this.value == null || this.value.trim().length==0){
                return ;
            }$.post("${pageContext.request.contextPath}/resource/demo3/deptname","id="+this.value,function (data) {
                $("#deptname").html(data);
            })
        }
    </script>--%>
</head>
<body>
<style>
    .tr_color{background-color: #9F88FF}
</style>
<div class="div_head">
            <span>
                <span style="float: left;">当前位置是：系统管理-》职位设置</span>
                <span style="float: right; margin-right: 8px; font-weight: bold;">
                    <a style="text-decoration: none;" href="add.jsp">【添加】</a>
					<a style="text-decoration: none;" href="#">【删除】</a>
                </span>
            </span>
</div>
<div></div>
<div class="div_search">
            <span>
                <form action="${pageContext.request.contextPath}/resource/demo3/all" method="get">
                    职位名称:
					<input type="text" name="name"  />
					 所属部门:
					<input type="text" name="deptId"  />
					是否启用:
					<select name="state">
						<option value="" >---请选择---</option>
						<option value="1">是</option>
						<option value="0">否</option>
					</select>
                    <input value="查询" type="submit" />

                </form>
            </span>
</div>
<div style="font-size: 13px; margin: 10px 5px;">
    <table class="table_a" border="1" width="100%">
        <tbody>
        <tr style="font-weight: bold;">
            <td width="40px;">序号</td>
            <td width="30px;"><input type="checkbox" /></td>
            <td width="80px;"> 职位编码</td>
            <td >职位名称</td>
            <td width="100px;">职位分类</td>
            <td width="120px;">所属部门</td>
            <td width="120px;">状态</td>
            <td align="center" width="100px;">操作</td>
        </tr>
        <c:forEach items="${roles}" var="r">
            <tr id="product1">
                <td>${r.id}</td>
                <td><input type="checkbox" /></td>
                <td>${r.number}</td>
                <td><a href="view.jsp">${r.rname}</a></td>
                <td>${r.type}</td>
                <td><span id="deptname">${r.dept.name}</span></td>
                <td>
                    <c:if test="${r.state==1}">
                        是
                    </c:if>
                    <c:if test="${r.state!=1}">
                        否
                    </c:if>
                </td>
                <td>
                    <a href="update.jsp">修改</a>
                    <a href="#">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div class="pagenation" style="height: 150px;width: 980px">
        <a href="${pageContext.request.contextPath}/resource/demo3/all?pageNum=1">首页</a>
        <c:if test="${page.hasPreviousPage}"><a href="${pageContext.request.contextPath}/resource/demo3/all?pageNum=${page.prePage}">上一页</a></c:if>
        <c:if test="${!page.hasPreviousPage}">上一页</c:if>
        <c:forEach var="i" begin="1" end="${page.navigateLastPage}">
            <c:if test="${i==page.pageNum }">
                <span style="background-color: #b1ceee"><a href="${pageContext.request.contextPath}/resource/demo3/all?pageNum=${i}">${i}</a></span>
            </c:if>
            <c:if test="${i!=page.pageNum }">
                <span><a href="${pageContext.request.contextPath}/resource/demo3/all?pageNum=${i}">${i}</a></span>
            </c:if>
        </c:forEach>
        <c:if test="${page.hasNextPage}"><a href="${pageContext.request.contextPath}/resource/demo3/all?pageNum=${page.nextPage}">下一页</a></c:if>
        <c:if test="${! page.hasNextPage}">下一页</c:if>

        <a href="${pageContext.request.contextPath}/resource/demo3/all?pageNum=${page.pages}">最后页</a>
    </div>
</div>
</body>
</html>
